Skip to content

feat: add field descriptions and validation for agent creation from template#935

Merged
hyacinthus merged 2 commits intomainfrom
hyacinthus
Jan 5, 2026
Merged

feat: add field descriptions and validation for agent creation from template#935
hyacinthus merged 2 commits intomainfrom
hyacinthus

Conversation

@hyacinthus
Copy link
Collaborator

This PR adds Pydantic field descriptions to AgentCreationFromTemplate and includes extra_prompt validation in AgentUpdate.

Changes

  • Added field descriptions to all fields in AgentCreationFromTemplate for better API documentation
  • Added extra_prompt to the field validator in AgentUpdate to prevent level 1 and level 2 headings
  • Updated tests to verify the new optional fields are correctly passed through

Copilot AI review requested due to automatic review settings January 5, 2026 15:26
@hyacinthus hyacinthus merged commit 8a663ef into main Jan 5, 2026
5 checks passed
@hyacinthus hyacinthus deleted the hyacinthus branch January 5, 2026 15:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the agent creation from template functionality by adding comprehensive field descriptions for better API documentation and extends validation to prevent level 1 and level 2 markdown headings in the extra_prompt field.

Key Changes:

  • Added Pydantic field descriptions to all fields in AgentCreationFromTemplate for improved API documentation
  • Extended field validation in AgentUpdate to include extra_prompt for heading restrictions
  • Updated tests to verify optional fields (readonly_wallet_address, weekly_spending_limit, extra_prompt) are correctly passed through

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
intentkit/core/template.py Added PydanticField descriptions to AgentCreationFromTemplate fields for better API documentation
intentkit/models/agent.py Extended field validator to include extra_prompt for preventing level 1 and level 2 markdown headings
tests/core/test_template.py Added test assertions to verify optional fields are correctly passed through when creating agents from templates
CHANGELOG.md Added version 0.8.41 release notes documenting new features and improvements
Comments suppressed due to low confidence (1)

intentkit/models/agent.py:830

  • This import of module re is redundant, as it was previously imported on line 6.
        import re

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +140 to +143
extra_prompt: str | None = PydanticField(
default=None,
description="Additional prompt text to be injected into the system prompt",
)
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra_prompt field in AgentCreationFromTemplate should have validation to prevent level 1 and level 2 headings (lines starting with "# " or "## "), consistent with the validation applied to extra_prompt in AgentUpdate. Without this validation, users could create agents from templates with invalid extra_prompt content that bypasses the heading restrictions enforced elsewhere in the system.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant